// by Xeno
//#define __DEBUG__
#define THIS_FILE "fn_addperframe.sqf"
#include "x_setup.sqf"

private ["_name", "_code", "_time", "_ar"];
PARAMS_3(_name,_code,_time); //_time = 0 = every frame
__TRACE_3("","_name","_code","_time");
_name = toLower _name;
_ar = GVAR(perframe_store) getVariable [_name, []];
_ar set [0, _code];
_ar set [1, _time];
_ar set [2, 0];
GVAR(perframe_store) setVariable [_name, _ar];
GVAR(perframe_array) set [count GVAR(perframe_array), _name];